/* Teach Tool  - Structural Dynamics
 * Copyright (C) 2009: Fabian Gerold, www.fabiangerold.de
 *
 * This file may be licensed under the terms of of the
 * GNU General Public License Version 3 (the "GPL").
 * 
 * Software distributed under the License is distributed 
 * on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 
 * express or implied. See the GPL for the specific language 
 * governing rights and limitations.
 *
 * You should have received a copy of the GPL along with this 
 * program. If not, go to http://www.gnu.org/licenses/gpl.html
 * or write to the Free Software Foundation, Inc., 
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

#ifndef WindowFree_h
#define WindowFree_h

#include <QtGui>

class SystemFree;
class Diagram;
class DiagramScroll;
class EMSWidget;

class WindowFree : public QWidget
{
    Q_OBJECT

public:
    WindowFree( SystemFree* sys );

public slots:
	void slotUpdateParameter( double, double, double, double );
	void initDisp();
	void startInitDisp();
	void diagPlusScale();
	void diagMinusScale();
	void slotStart();
	void slotUpdateTime( double sec );
	void slotClearOutput();
	void slotAppendOutput( const QString& text );
	
	
private slots:
	void toggle_stop();
	void resetSystem();
	void spring_changed( int slider_pos );
	void spring_changed();
	void mass_changed( int slider_pos );
	void mass_changed();
	void damp_changed( int slider_pos );
	void damp_changed();
	void checkUChanged();
	void txt_out_radio();
	void clipboard();
	void showAbout( bool checked );
	//void checkOpenGLChanged( int state );
	
private:
	QWidget*	createSimWidget();
	QWidget*	createAboutWidget();
	QWidget*	createControlWidget();
	QWidget*	createParamsWidget();
	
	SystemFree*		m_system;
	DiagramScroll*	m_diagscroll;
	Diagram*		m_diag;
    QLabel*			m_time_label;
	QLabel*			m_label_hint;
	QLabel*			m_label_diag_scale;
	EMSWidget*		m_ems;
	
	QPushButton*	m_btn_stop;
	QPushButton*	m_btn_reset;
	QLineEdit*		m_le_init_disp;
	QPushButton*	m_btn_init_disp;

	QCheckBox*		m_check_u;
	QCheckBox*		m_check_up;
	QCheckBox*		m_check_upp;

	//QWidget*		m_control_widget;
	//QWidget*		m_params_widget;
	QSlider*		m_slide_spring;
	QLineEdit*		m_le_spring;
	QSlider*		m_slide_mass;
	QLineEdit*		m_le_mass;
	QSlider*		m_slide_damp;
	QLineEdit*		m_le_damp;

	QLabel*			m_T_label;
	QLabel*			m_f_label;
	QLabel*			m_omega_label;
	QLabel*			m_omega_d_label;

	QTextEdit*		m_textedit;
	QRadioButton*	m_radio_notext;
	QRadioButton*	m_radio_slowtext;
	QRadioButton*	m_radio_fasttext;
	QPushButton*	m_btn_clipboard;
	QStackedWidget* m_stack;
};

#endif
